(shadow-copy-file): Handle buffer-swapped-with.
authorRichard M. Stallman <rms@gnu.org>
Mon, 22 Dec 2008 20:20:04 +0000 (20:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 22 Dec 2008 20:20:04 +0000 (20:20 +0000)
lisp/shadowfile.el

index 751a33d260d9661884c3162d36f39b169b8c03ff..ece12c367e12c5265742e7f426da8db801c72d39 100644 (file)
@@ -574,8 +574,14 @@ site."
     (when buffer
       (set-buffer buffer)
       (condition-case i
-          (progn
-            (write-region nil nil to)
+         (progn
+           (if buffer-swapped-with
+               (progn
+                 (buffer-swap-text buffer-swapped-with)
+                 (unwind-protect
+                     (write-region nil nil to)
+                   (buffer-swap-text buffer-swapped-with)))
+             (write-region nil nil to))
             (shadow-remove-from-todo s))
         (error (message "Shadow %s not updated!" (cdr s)))))))